package net;

import net.sending.*;
import net.message.Message;

import java.util.HashSet;

public class SimpleSendingMessageFactory implements SendingMessageFactory {

    public BroadcastMessage getSendingMessage(Message message) {
        return new Broadcast(message);
    }

    public MulticastMessage getSendingMessage(Message message, HashSet<Client> clients) {
        return new Multicast(message, clients);
    }

    public UnicastMessage getSendingMessage(Message message, Client client) {
        return new Unicast(message, client);
    }

    private static SimpleSendingMessageFactory ourInstance = new SimpleSendingMessageFactory();

    public static SimpleSendingMessageFactory getInstance() {
        return ourInstance;
    }

    private SimpleSendingMessageFactory() {
    }
}
